Private f1 As Boolean, fChange As Boolean, op As Boolean
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal Hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub Exit_Click()
Unload Me
End Sub
Private Sub FileClass_FilesDroped()
On Error Resume Next
List1.Clear
List1.AddItem FileClass.FileName(0)
FLoad FileClass.FileName(0)
End Sub
Private Sub Form_Load()
Set FileClass = New CDrag_Drop
With size
.hParam = Height
.wParam = Width
.Map List1, RS_WidthOnly
.Map RT, RS_Height_Width
End With
If Command <> "" Then
Me.Show
List1.AddItem Command
FLoad Command
'f1 = True
fChange = False
op = True
End If
FileClass.DragHwnd = List1.Hwnd
FileClass.StartDrag
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim r As Integer
If fChange = True Then
r = Ask
Select Case r
Case vbYes:
Save_Click
Case vbCancel:
Cancel = 1
'Exit Sub
End Select
End If
End Sub
Private Function Ask() As Integer
Ask = MsgBox("The contents of the file have been changed." & _
vbCrLf & "Do you want to save the changes ?", vbYesNoCancel, "Save Changes")
End Function
Private Sub Form_Resize()
size.rSize Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
'The window is being subclassed so we must stop subclassing
'before leaving or CRASH BOOM BANG!!!
'On the other hand, even if you dont call StopDrag method, nothing
'will happen as the subclassing is automatically turned safely